<%@page import="java.util.Iterator"%>
<%@page import="com.xhd.vo.Fruits"%>
<%@page import="java.util.List"%>
<%@page import="com.xhd.Dao.SalerDaoImpl"%>
<%@page import="com.xhd.Dao.SalerDao"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<meta http-equiv="content-type" content="text/html;charset=utf-8">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<style type="text/css">
	* {
		font-size: 11pt;
	}
	div {
		border: solid 2px rgb(78,78,78);
		width: 75px;
		height: 75px;
		text-align: center;
	}
	li {
		margin: 10px;
	}
</style>
</head>
 <body style="background: rgb(254,238,189);">
	<c:if test="${ not empty sessionScope.user}">
	<h1 align="center">历史信息</h1>
	<% 
	SalerDao sd = new SalerDaoImpl();
	List<Fruits> fruitlist1=sd.haveFruitOrNot("已售出");
	Iterator<Fruits> fIter1=fruitlist1.iterator();
	
	List<Fruits> fruitlist2=sd.haveFruitOrNot("被冻结");
	Iterator<Fruits> fIter2=fruitlist2.iterator();
	
	List<Fruits> fruitlist3=sd.haveFruitOrNot("待售");
	Iterator<Fruits> fIter3=fruitlist3.iterator();
	
	Fruits fruit=null;
	%>
<table border="1" width="100%" cellspacing="0" background="black">
		<tr bgcolor="rgb(78,78,78)" bordercolor="rgb(78,78,78)" align="center" style="color: white;">
		<th>水果名</th>
		<th>水果描述</th>
		<th>水果价格</th>
		<th>水果状态</th>		
		</tr>
	<% 
	while(fIter1.hasNext()){
		fruit=fIter1.next();
	%>	


		<tr bordercolor="rgb(78,78,78)" align="center">
		<td><%=fruit.getFruit_name() %></td>
		<td><%=fruit.getFruit_describe() %></td>
		<td><%=fruit.getFruit_price() %></td>
		<td><%=fruit.getFruit_state() %></td>
		</tr>
	<%
	}
	%>
	<% 
	while(fIter2.hasNext()){
		fruit=fIter2.next();
	%>	
		<tr bordercolor="rgb(78,78,78)" align="center">
		<td><%=fruit.getFruit_name() %></td>
		<td><%=fruit.getFruit_describe() %></td>
		<td><%=fruit.getFruit_price() %></td>
		<td><%=fruit.getFruit_state() %></td>
		</tr>
	<%
	}
	%>
	<% 
	while(fIter3.hasNext()){
		fruit=fIter3.next();
	%>	
		<tr bordercolor="rgb(78,78,78)" align="center">
		<td><%=fruit.getFruit_name() %></td>
		<td><%=fruit.getFruit_describe() %></td>
		<td><%=fruit.getFruit_price() %></td>
		<td><%=fruit.getFruit_state() %></td>
		</tr>
	<%
	}
	%>
	</table>
	</c:if>
<c:if test="${  empty sessionScope.user}">
<h1>你还未登录！</h1>
<a href="SalerLogin.jsp">点击登录</a>
</c:if>
</body>
</html>